package com.diy.springframework.step.reader;

import com.diy.springframework.step.registry.BeanDefinitionRegistry;
import com.diy.springframework.step.loader.DefaultResourceLoader;
import com.diy.springframework.step.loader.ResourceLoader;

/**
 * @program: diy_spring
 * @description:
 * @author: CaoYong
 * @create: 2021-07-22 10:06
 **/
public abstract class AbstractBeanDefinitionReader implements BeanDefinitionReader {

    private final BeanDefinitionRegistry registry;

    private ResourceLoader resourceLoader;

    public AbstractBeanDefinitionReader(BeanDefinitionRegistry registry) {
        this(registry, new DefaultResourceLoader());
    }

    public AbstractBeanDefinitionReader(BeanDefinitionRegistry registry, ResourceLoader resourceLoader) {
        this.registry = registry;
        this.resourceLoader = resourceLoader;
    }

    @Override
    public BeanDefinitionRegistry getRegistry() {
        return registry;
    }

    @Override
    public ResourceLoader getResourceLoader() {
        return resourceLoader;
    }
}
